class Message < ActiveRecord::Base
  
  belongs_to :chatroom
  belongs_to :user
  
  before_save :set_time
  
  validates_presence_of :message
  
  def set_time
    self.time = Time.now.to_s(:send_time)
  end
  
end
